package com.biz.primus.app.rest.feign;

import com.biz.primus.app.rest.degraded.DegradedProductFeignClient;
import com.biz.primus.base.vo.PageResult;
import com.biz.primus.base.vo.ProductListRestVo;
import com.biz.primus.commodity.vo.frontend.ProductDetailRequestVo;
import com.biz.primus.commodity.vo.frontend.ProductDetailResult;
import com.biz.primus.commodity.vo.frontend.RecommendProductReqVo;
import com.biz.primus.search.vo.search.SearchProductRequestVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author jiangnan
 * @Description:
 */
@FeignClient(name = "service-product", fallback = DegradedProductFeignClient.class)
public interface ProductFeignClient {

    @PostMapping("soa/frontendProductService/productDetail")
    ProductDetailResult productDetail(@RequestBody ProductDetailRequestVo requestVo);

    @PostMapping("soa/frontendProductService/recommendProducts")
    List<ProductListRestVo> recommendProducts(@RequestBody RecommendProductReqVo reqVo);

    @PostMapping("soa/frontendProductService/searchProduct")
    PageResult<ProductListRestVo> searchProduct(@RequestBody SearchProductRequestVo reqVo);
}
